<?php

namespace common\models\PlugsRunTotal;

use Yii;

/**
 * This is the model class for table "plugs_run_total".
 *
 * @property string $id
 * @property string $agent_uid
 * @property string $manager_uid
 * @property string $plug_id
 * @property string $terminal_num
 * @property string $created_date
 * @property string $province
 * @property string $city
 * @property string $created_ym
 * @property string $fail_terminal_num 无效的终端数
 */
class PlugsRunTotalBase extends \common\models\CommonModel\CommonModel
{
    /**
     * {@inheritdoc}
     */
    public static function tableName()
    {
        return 'plugs_run_total';
    }

    /**
     * {@inheritdoc}
     */
    public function rules()
    {
        return [
            [['agent_uid', 'manager_uid', 'plug_id', 'created_date'], 'required'],
            [['agent_uid', 'manager_uid', 'plug_id', 'terminal_num', 'fail_terminal_num'], 'integer'],
            [['created_date'], 'safe'],
            [['province', 'city'], 'string', 'max' => 100],
            [['created_ym'], 'string', 'max' => 7],
            [['plug_id', 'manager_uid', 'agent_uid', 'created_date'], 'unique', 'targetAttribute' => ['plug_id', 'manager_uid', 'agent_uid', 'created_date']],
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'agent_uid' => 'Agent Uid',
            'manager_uid' => 'Manager Uid',
            'plug_id' => 'Plug ID',
            'terminal_num' => 'Terminal Num',
            'created_date' => 'Created Date',
            'province' => 'Province',
            'city' => 'City',
            'created_ym' => 'Created Ym',
            'fail_terminal_num' => 'Fail Terminal Num',
        ];
    }
}
